{layout name="public/layout" /}

        {include file='yxnavbar'}
<style>
.table td span{display:inline-block;margin-top:4px;}
.table td input{margin-bottom:0;}
</style>
{if $op == 'first'}
    <div class="panel panel-info">
        {if !empty($timetxt)}
        <div class="panel-heading" style="background: #F0E68C;text-align: center;">{$timetxt}</div>
        {else}
        <div class="panel-heading">当前数量： {$total}</div>
        {/if}
        
    </div>
<!--    <div class="panel panel-info">
        <div class="panel-heading">筛选</div>
        <div class="panel-body">
            <form action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="{$_P['m']}" />
                <input type="hidden" name="do" value="{$do}" />
                <input type="hidden" name="themeid" value="{$id}" />
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">关键字</label>
                    <div class="col-sm-6 col-md-6 col-lg-6 col-xs-12">
                        <input type="text" class="form-control" name="keyword" value="{$_P['keyword']}" />
                    </div>
                    <div class="pull-left col-xs-12 col-sm-3 col-md-2 col-lg-2">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        <input type="hidden" name="__token__" value="{$Request.token}"/>
                    </div>
                </div>
            </form>
        </div>
    </div> -->
    <div class="main">
        <table class="table bootstrap-table table-hover site-list">
     {loop $list $row}

            <tr>
                <th colspan="2" class="text-left">活动名称【{$softname}-{$row['id']}】</th>
                <th class="text-left" ></th>
                <th class="text-left" width="180px">数据【{$softname}-{$row['id']}】</th>
                <th class="text-left" ></th>
                <th class="text-left" width="160px"></th>
            </tr>
           
            <tr>
                <td class="text-left vertical-middle" style="min-width: 120px">
                    <div class="site-item-img1">
                        <img src="{php echo tomedia($row['headlogo']);}" width="100px" />
                    </div>
                </td>
                <td class="text-left" style="max-width: 260px"> 
                    <div class="bootstrap-margin-bottom" style="height: 40px;">
                        <p class="color-gray">主标题</p> 
                        <span class="color-dark">{$row['title']}</span>
                    </div>
                    <div class="bootstrap-margin-bottom" style="height: 40px;">
                        <p class="color-gray">副标题</p> 
                        <span class="color-dark">{$row['desc']}</span>
                    </div>
                    <div class="">
                        <p class="color-gray">时间</p>
                        <a href="javascript:;" class="color-dark" >开始：{php echo date("Y-m-d H:i:s", $row['begintime']);}

                        <br>
                            结束：{php echo date("Y-m-d H:i:s", $row['endtime']);}</a>
                    </div>
                </td>
                <td ></td>
                <td class="text-left">
    <p class="color-gray">参与人数：<span class="label label-primary">{$row['fanscount']}</span></p>
    <p class="color-gray">浏  览  量：  <span class="label label-success">{$row['scansum']}</span></p>
    <p class="color-gray">转  发  量：  <span class="label label-info">{$row['forward']}</span></p> 
    <p class="color-gray">付款人数：<span class="label label-warning">{$row['recordcount']}</span></p> 
    <p class="color-gray">付款金额：<span class="label label-info">{$row['ordercount']}元</span></p>
    {if $system['fenxiao']==1 || $row['commcount'] != 0}
    <p class="color-gray">红包发放：<span class="label label-danger">{$row['commcount']}元</span></p>
    {/if}

    {if $row['chongzhi']>0 }
    <p class="color-gray">充&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;值：&nbsp;<span class="label label-success">{$row['chongzhi']}元</span></p>
    {elseif ($row['chongzhi']<0) }
    <p class="color-gray">已  提  现：  <span class="label label-success">{$row['chongzhi']}元</span></p>
    {/if}
    <p class="color-gray">实际到帐：<span class="label label-success">{$row['daozhang']}元</span></p>  </td>

                <td ></td>
                <td class="text-left">
                </td>
            </tr>
            {if $_G['isSuperAdmin'] }
            <tr>
                <th colspan="7" class="text-right" style="color: #888888">{$row['keyword']}{if !empty($row['xiaoshou'])}销售：{$row['xiaoshou']}{/if} {if !empty($row['kefu'])} 客服：{$row['kefu']}{/if}</th>
            </tr>
            {/if}
            <tr style="height: 30px;">
            </tr>
    {/loop}
        </table>
    </div>
    <div class="panel-body" style="">
        <div class="form-group">
            <div class="col-sm-2 col-xs-12">
                <a class="btn btn-info btn-sm" style="font-size: 16px;font-weight:bold" 
                            href="{php echo createWebUrl($do, array('op'=>'copytheme','soft'=>$soft));}"
                            title=""><i class="fa fa-ren">仅复制活动内容</i></a>
            </div>
            {if $system['s']['isdaoru']==1}
            <!-- if DOMAIN0 !=="30.yixuan.net" -->
                {if ($system['s']['domain1']=="www.yixuan.net" || DOMAIN0=="19.yixuan.net") && $totaldaozhang>0.1 }
                <div class="col-sm-6 col-xs-12">
                    <a class="btn btn-danger btn-sm" style="font-size: 16px;font-weight:bold" 
                                title=""><i class="fa fa-ren"> 全部复制（有{$totaldaozhang}元未提现，不可转移）</i></a>
                </div>
                {else}
                <div class="col-sm-6 col-xs-12">
                    <a class="btn btn-success btn-sm" style="font-size: 16px;font-weight:bold" 
                                href="{php echo createWebUrl($do, array('op'=>'copyall','soft'=>$soft));}"
                                title=""><i class="fa fa-ren"> 全部复制（活动内容+活动数据）</i></a>
                                <p class="color-gray"><span style="color: #5cc0de">全部复制,</span><span style="color: #d9534f">原来链接将失效</span><span style="color: #5cc0de">会自动跳转至新链接中</span></p>
                </div>
                {/if}
            <!-- else
                <div class="col-sm-2 col-xs-12">
                    <a class="btn btn-info btn-sm" style="font-size: 16px;font-weight:bold" 
                                href=""
                                title=""><i class="fa fa-ren">复制为案例-未开发</i></a>
                </div>
            /if -->
            {else}
                <div class="col-sm-2 col-xs-12">
                    <a class="btn btn-warning btn-sm" style="font-size: 16px;font-weight:bold" 
                                href=""
                                title=""><i class="fa fa-ren">此服务器不支持全部复制!</i></a>
                </div>
            {/if}
        </div>
    </div>
{elseif $op == 'finished'}
<div class="main">
  <div class="panel panel-default">
        {if $_P['copytype']!=='all'}
            <div class="panel-heading">
                        <div style="text-align:right;" >
                          <a class="btn btn-info btn-sm "href="{php echo createWebUrl($do, array('op' => 'delete','soft'=>$soft));}" title="添加"><i class="icon-edit"></i>清空重新导入</a>
                        </div>
            </div>
        {/if}
        <div class="panel-body table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                    <tr>
                        <th >表名</th>
                        <th >原服务器【{$softnamesource}】</th>
                        <th >新服务器【{$softname}】</th>
                        <th >差异</th>
                    </tr>
                </thead>
                <tbody>
                {loop $countkey $index $item}
                {php $chayi = $countsource[$item]-$count[$item];}
                  <tr> 
                    <td>{$item}</td>
                    <td>{$countsource[$item]}</td>
                    <td>{$count[$item]}</td>
                    <td>{php echo $chayi ==0?0:"<span style='color: #ff0000'>".$chayi."</span>";}</td>
                </tr>
                {/loop}
                {if $_P['copytype']=='all'}
                    {loop $count1key $index $item}
                    {php $chayi = $countsource[$item]-$count1[$item];}
                      <tr> 
                        <td>{$item}</td>
                        <td>{$countsource[$item]}</td>
                        <td>{$count1[$item]}</td>
                        <td>{php echo $chayi ==0?0:"<span style='color: #ff0000'>".$chayi."</span>";}</td>
                    </tr>
                    {/loop}
                {/if}
            </tbody>
            </table>
        </div>
        {$pager}

                    
    </div>
    </div>
{/if}

<script type="text/javascript">
    $(function(){
        $('.app-preview').click(function(){
            return false;
        });
        require(['underscore', 'bootstrap.switch'], function() {
            $(":checkbox[name='status[]']").bootstrapSwitch();
            $(':checkbox').on('switchChange.bootstrapSwitch', function(e, state){
                $this = $(this);
                var id = $(this).data('id');
                var status = this.checked ? 1 : 0;
                $.post("{php echo createWebUrl($do, array('op' => 'status'));}", {status:status,id: id}, function(resp){
                    resp = $.parseJSON(resp);
                    if(resp.message.errno != 0) {
                        layer.msg('操作失败, 请稍后重试');
                    } else {
                        layer.msg('操作成功');
                    }
                });
            });     
            
        });
    });
</script>
<script type="text/javascript">
    function check(){
        if($.trim($(':text[name="qrnum"]').val()) == '') {
            alert('请输入数量');
            return false;
        }

    }
</script>
